import { createBrowserRouter, Navigate } from "react-router-dom";
import UnLoginIndex from '../pages/UnLoginIndex'
import LayOut from '../pages/LayOut'
// 老师页面引入
import TeacherIndex from '../pages/Teacher/TeacherIndex'
import TeacherMyCourses from '../pages/Teacher/MyCourses/MyCourses'
import TeacherCoursesCenter from '../pages/Teacher/CoursesCenter/CoursesCenter'
import TeacherMySchedule from '../pages/Teacher/MySchedule/MySchedule'
import TeacherMyClass from '../pages/Teacher/MyClass/MyClass'
import TeacherTaskPanel from '../pages/Teacher/TaskPanel/TaskPanel'
import TeacherDataInsight from '../pages/Teacher/DataInsight/DataInsight'
// 学生页面引入
import StudentIndex from '../pages/Student/StudentIndex'
import StudentMyCourses from '../pages/Student/MyCourses/MyCourses'
import StudentCoursesCenter from '../pages/Student/CoursesCenter/CoursesCenter'
import StudentLearningNotes from '../pages/Student/LearningNotes/LearningNotes'
import StudentMyFiles from '../pages/Student/MyFiles/MyFiles'
import StudentGrowthRecord from '../pages/Student/GrowthRecord/GrowthRecord'
import StudentAccountSettings from '../pages/Student/AccountSettings/AccountSettings'
import Notfound from '../pages/Notfound'

export const router = createBrowserRouter([
    {
        path: "/",
        meta: { title: '首页' },
        element: <UnLoginIndex></UnLoginIndex>,
    },
    {
        path: '/index',
        meta: { title: '布局' },
        element: <LayOut></LayOut>,
        children: [
            {
                path: 'teacher',
                meta: { title: '首页', role: 'teacher' },
                element: <TeacherIndex></TeacherIndex>
            },
            {
                path: 'courses',
                meta: { title: '我的课程', role: 'teacher' },
                element: <TeacherMyCourses></TeacherMyCourses>
            },
            {
                path: 'center',
                meta: { title: '课程中心', role: 'teacher' },
                element: <TeacherCoursesCenter></TeacherCoursesCenter>
            },
            {
                path: 'schedule',
                meta: { title: '我的日程', role: 'teacher' },
                element: <TeacherMySchedule></TeacherMySchedule>
            },
            {
                path: 'class',
                meta: { title: '我的班级', role: 'teacher' },
                element: <TeacherMyClass></TeacherMyClass>
            },
            {
                path: 'panel',
                meta: { title: '任务看板', role: 'teacher' },
                element: <TeacherTaskPanel></TeacherTaskPanel>
            },
            {
                path: 'data',
                meta: { title: '数据洞察', role: 'teacher' },
                element: <TeacherDataInsight></TeacherDataInsight>
            },
            {
                path: 'student',
                meta: { title: '我的实践星球', role: 'student' },
                element: <StudentIndex></StudentIndex>
            },
            {
                path: 's_courses',
                meta: { title: '我的课程', role: 'student' },
                element: <StudentMyCourses></StudentMyCourses>
            },
            {
                path: 's_center',
                meta: { title: '课程中心', role: 'student' },
                element: <StudentCoursesCenter></StudentCoursesCenter>
            },
            {
                path: 's_notes',
                meta: { title: '学习笔记', role: 'student' },
                element: <StudentLearningNotes></StudentLearningNotes>
            },
            {
                path: 's_Files',
                meta: { title: '我的文件', role: 'student' },
                element: <StudentMyFiles></StudentMyFiles>
            },
            {
                path: 's_recode',
                meta: { title: '成长记录', role: 'student' },
                element: <StudentGrowthRecord></StudentGrowthRecord>
            },
            {
                path: 's_account',
                meta: { title: '账户设置', role: 'student' },
                element: <StudentAccountSettings></StudentAccountSettings>
            },
        ]
    },
    {
        path: "*",
        element: <Notfound />,
    },
]);

export default router;
